<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>找回密码</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="../../css/mui.min.css" rel="stylesheet" />
		<link href="../../css/login.css" rel="stylesheet" />
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
		    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
		    <h1 class="mui-title">注 册</h1>
		</header>
		<div class="mui-content">
		    <form>
		    	<div class="mui-input-group">
		    		<div class="mui-input-row">
		    			<input type="text" placeholder="手机号或邮箱" id="userName"/>
		    		</div>
		    		<div class="mui-input-row">
		    			<input type="password" class="mui-input-password" placeholder="密码" id="pwd"/>
		    		</div>		    		
		    		<input type="text" maxlength="4" placeholder="请输入四位验证码" id="checkNum" />
		    		<button id="getCheckNum">获取验证码</button>
		    	</div>
		    	<button id="nextBtn" class="mui-btn mui-btn-primary">下一步</button>
		    </form>
		</div>
		<script src="../../js/mui.min.js"></script>
		<script type="text/javascript">
			function getById(id){
				return document.getElementById(id)
			}
			mui.init()
			//
			//
			//
			var userName=getById('userName'),pwd=getById('pwd'),checkNum=getById('checkNum');
			var nextBtn=getById('nextBtn');
			//注册下一步相关事件
			nextBtn.addEventListener('tap',function(){
				checkFormItems();
			})
			function checkFormItems(){
				//检验form表单有输入是否标准
				if(!userName.value){
					mui.alert('请输入注册账号！')
				}else if(!pwd.value){
					mui.alert('请输入账号密码！')
				}else if(pwd.value.length<6){
					mui.alert('请输入6位以上的密码！')
				}else if(!checkNum.value){
					mui.alert('请输入验证码！')
				}else{
					mui.alert('注册成功！将在3秒后跳转首页..')
					setTimeout(function(){
						mui.openWindow({
						url:'../../index.html',
						id:'index.html'
					})
					},3000)
					
				}
			}
		</script>
	</body>

</html>